//
//  SearchDiagnostic.h
//  Cabinet
//
//  Created by Pierre MONTSEGUR on 12/06/11.
//  Copyright 2011 PM. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "Diagnostic.h"

@interface SearchDiagnostic : NSWindowController<NSTableViewDataSource> {
@private
    NSMutableArray *mDiagnostics;
    NSTableView *__unsafe_unretained mDiagnosticsView;
    
    NSManagedObjectContext * mManagedObjectContext;
    
    NSInteger mSelectedIndex;
    int mResult;
}

@property (nonatomic, strong) NSManagedObjectContext * mManagedObjectContext;
@property (unsafe_unretained) IBOutlet NSTableView *mDiagnosticsView;

// NSTableViewDataSource
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex;

- (NSInteger) count;

- (IBAction)okAction:sender;
- (IBAction)annulerAction:sender;

- (void) closeWindow;
- (void) withParentWindow:parentWindow;
- (int) returnCode;
- (void) setDiagnostics:(NSArray*)aDiagnisticsList;


- (Diagnostic*)getDiagnosticAtIndex:(NSInteger)aRowIndex;
- (Diagnostic*)selectedDiagnotic;

- (IBAction)supprimerAction:sender;

@end
